package com.foolrabbit.springbootlearning.event.listener;

import com.foolrabbit.springbootlearning.event.entity.CryEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 宝宝哭事件监听器
 */
@Component
public class BabyCryListener implements ApplicationListener<CryEvent> {
    @Override
    public void onApplicationEvent(CryEvent event) {
        System.out.println("宝宝哭啦，宝宝叫：" + event.getName());
    }
}
